﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Computer_Manager.DAL;
using Computer_Manager.DTO;

namespace Computer_Manager.BUS
{
    public class BUS_categories
    {
        DAL_categories dal = new DAL_categories();

        public void categories_insert(DTO_categories obj)
        {
            try
            {
                dal.categories_insert(obj);
            }
            catch (Exception)
            {
                
                throw;
            }

        }

        public void categories_Update(DTO_categories obj)
        {
            try
            {
                dal.categories_Update(obj);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public void categories_Delete(DTO_categories obj)
        {
            try
            {
                dal.categories_Delete(obj);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable GetByID(DTO_categories obj)
        {
            DataTable dt = new DataTable();
            try
            {
               dt=dal.GetByID(obj);
            }
            catch (Exception)
            {

                throw;
            }
            return dt;
        }

        public DataTable GetByParentId(DTO_categories obj)
        {
            DataTable dt = new DataTable();
            try
            {
                dt = dal.GetByPatentID(obj);
            }
            catch (Exception)
            {

                throw;
            }
            return dt;
        }

        public DataTable GetByParentCat(DTO_categories obj)
        {
            DataTable dt = new DataTable();
            try
            {
                dt = dal.GetByParentCat(obj);
            }
            catch (Exception)
            {

                throw;
            }
            return dt;
        }

        public DataTable GetAll()
        {
            DataTable dt = new DataTable();
            try
            {
                dt = dal.GetAll();

            }
            catch (Exception)
            {

                throw;
            }
            return dt;
        }
    }
}
